//
//  NewCell.m
//  卢卡的时光网
//
//  Created by 卡神 on 15/7/21.
//  Copyright © 2015年 lok. All rights reserved.
//

#import "NewCell.h"
#import "UIImageView+WebCache.h"

@implementation NewCell

- (void)setNews:(News *)news {
    _news = news;
    [self setNeedsLayout];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [self.imageView1 sd_setImageWithURL:[NSURL URLWithString:_news.image] placeholderImage:[UIImage imageNamed:@"4"]];
    self.title.text = _news.title;
    self.summary.text = _news.summary;
    switch (_news.type) {
        case 0:
            self.flag.image = nil;
            break;
        case 1:
            self.flag.image = [UIImage imageNamed:@"sctpxw"];
            break;
            case 2:
            self.flag.image = [UIImage imageNamed:@"scspxw"];
            break;
        default:
            break;
    }
 
}


- (void)awakeFromNib {
    
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
